import subprocess
cmd="cmd.exe"
begin=101
end=200
while begin<end:
    p=subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE,
stdin=subprocess.PIPE,
stderr=subprocess.PIPE)
    p.stdin.write(("ping 192.168.1."+str(begin)+"\n").encode(encoding="utf-8"))
    p.stdin.close()
    p.wait()
    print("execution result: %s"%p.stdout.read())
    begin=begin+1
